home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d7 / ap102.arc / MPTXMT.SLT < prev    next >
Text File  |  1991-04-17  |  2KB  |  71 lines

  1. str mptcmd [127];
  2. main()
  3. {
  4.     int lfp, len, c, first, last, ret;
  5.     str fullpath [80];
  6.     str file[80];
  7.     str port [4];
  8.     str protocol[5]="mpt";    // puma users: change "mpt" to "puma"
  9.  
  10.     lfp=fopen ("mptlist","w");
  11.     if (lfp == -1) {
  12.         prints ("cannot open list file");
  13.         return (0);
  14.     }
  15.  
  16.     len=strlen (_ext_filespec);
  17.     first=0;
  18.     last=0;
  19.     while (last < len) {
  20.         last=strchr (_ext_filespec, first, ' ');
  21.         if (last == -1) last = len;
  22.         substr (_ext_filespec,first,last-first,file);
  23.         if (first == 0) {
  24.             // first file already has dir prepended.
  25.             fputs (file,lfp);
  26.         }
  27.         else {
  28.             if (strchr (file, 0, '\') == -1 && subchr (file, 1) != ':') {
  29.                 fullpath = _up_dir;
  30.                 strcat (fullpath,file);
  31.                 fputs (fullpath,lfp);
  32.             }
  33.             else fputs (file,lfp);
  34.         }
  35.         fputs ("^M^J",lfp);
  36.         first=last+1;
  37.     }
  38.     fclose (lfp);
  39.     mptcmd="N+ F+ M- P";
  40.     itos (get_port(), port);
  41.     strcat (mptcmd, port);        // add port
  42.     strcat (mptcmd, " S0");    // port speed (0=auto adjust)
  43.     if (_zmod_scrash) strcat (mptcmd, " R+");    // resume file
  44.     else strcat (mptcmd, " O+");            // overwrite file
  45.     if (_sound_on) strcat (mptcmd, " B+");        // beep when finished
  46.     else strcat (mptcmd, " B-");            // silence
  47.     strcat (mptcmd, " X+ s @mptlist");
  48.     prints (mptcmd);
  49.     ret=run (protocol,mptcmd,0);
  50.     fdelete ("mptlist");
  51.     if (_sound_on) {
  52.         if (ret) {
  53.             // command failed.  descending tones
  54.             for (c=1; c<=3; ++c) {
  55.                 tone (790,17);
  56.                 tone (657,17);
  57.                 tone (530,17);
  58.             }
  59.         }
  60.         else {
  61.             // command succeeded.  ascending tones
  62.             for (c=1; c<=3; ++c) {
  63.                 tone (530,17);
  64.                 tone (657,17);
  65.                 tone (790,17);
  66.             }
  67.         }
  68.     }
  69.     return (0);
  70. }
  71.